<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-edit.php");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-function.php");
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">
<h1> 人员资料 </h1>




<div class="detail-box member-edit-box layui-form">

<div class="detail-boxes">
<ul class="detail-boxing"> 



<form id="edit-member-form" method="post" action="detail-edit-function.php?nav-itemed=member&nowpageid=<?echo $_GET["nowpageid"]?>" enctype="multipart/form-data" class="layui-form">
 
  
 <input type="hidden" name="nid" value="<? echo $detail['nid']?>">
 
 
  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-block">
      <input type="text" name="ai_name" required  lay-verify="required" placeholder="请输入名字" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
    </div>
  </div>

<!---->
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">图片</label>-->
<!--<div class="layui-upload">-->
<!---->
<!--<div class="layui-upload-list">-->
<!--<img class="layui-upload-img" id="icon">-->
<!--<p id="demoText"></p>-->
<!--</div>-->
<!---->
<!--<label class="layui-form-label"> </label> <button type="button" class="layui-btn" id="test1">上传图片</button>-->
<!---->
<!--</div>-->
<!--</div>-->
<!--</div>-->

<div class="layui-form-item icon">

    <label class="layui-form-label">图片：</label>

    <div class="layui-input-block">
<div class="image">
        <?php
        if ($detail['icon'] != 'alpha.gif' && $detail['icon'] != '') {
            ?>
            <img src="<?
            if ($detail_storage) {
                echo $detail_storage;
            } else {
                echo $site_domin;
            }
            ?>/uploadfiles/<? echo $theme_folder ?>/<? echo $detail['icon'] ?>" width="100"/>
        <?php } ?>
</div>
        <a href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=icon&sys_part=<? echo $system_part ?>">删除</a>
        <span class="title-data">(请上传像素<? echo $first_icon_data[0] ?>X<? echo $first_icon_data[1] ?>的图片,格式为jpeg)</span>
    </div>
</div>

<li class="layui-form-item icon">
    <label class="layui-form-label"> </label>
    <div class="layui-input-block">   <input type="file" name="icon" onchange="fileChange(this);"/></div><em class="explain">(上传列表图标)</em></li>
</div>





    <div class="layui-form-item">
        <label class="layui-form-label">微信</label>
        <div class="layui-input-block">
            <input type="text" name="ai_weixin"   autocomplete="off" class="layui-input"  value="<? echo $detail['weixin']?>">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="ai_email"   autocomplete="off" class="layui-input"  value="<? echo $detail['email']?>">
        </div>
    </div>




    <?
    $unit_list=select_lines_all_items($table_Prefix."unit","nid desc","","0");
    $unit=select_one_line_all_items($table_Prefix."unit","nid = '".$detail['unit']."'");
    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">所属单位</label>
        <div class="layui-input-block">
            <select name="ai_unit" lay-search="" >
                <option value="<? echo $detail['unit']?>"><? echo $detail['unit']." : ".$unit['name']?></option>
                <option value="">无</option>
                <? for($i=0;$i<count($unit_list);$i++){ ?>
                    <option value="<? echo $unit_list[$i]['nid'] ?>"><? echo $unit_list[$i]['nid'] ?> : <? echo $unit_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>







    <div class="layui-form-item">
        <label class="layui-form-label">好感度</label>
        <div class="layui-input-block" >
            <input type="radio" name="ai_favourable"  value="友好"     title="友好"      <? if($detail['favourable']=="友好")   {echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="互相仇恨"  title="互相仇恨"  <? if($detail['favourable']=="互相仇恨"){echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="仇视我方"  title="仇视我方"  <? if($detail['favourable']=="仇视我方"){echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="我方仇视"  title="我方仇视"  <? if($detail['favourable']=="我方仇视"){echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="我方不满"  title="我方不满"  <? if($detail['favourable']=="我方不满"){echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="不满我方"  title="不满我方"  <? if($detail['favourable']=="不满我方"){echo "checked";} ?>>
            <input type="radio" name="ai_favourable"  value="普通"     title="普通"      <? if($detail['favourable']=="普通")    {echo "checked";} ?>>
        </div>

    </div>



<? $tag_list=select_lines_all_items($table_Prefix."option","nid desc","originate = 'member ' and type = 'tag' ","0"); ?>

<div class="layui-form-item">
<label class="layui-form-label">标签</label>

<div class="layui-input-block" >
<? foreach ($tag_list as $k => $v){?>
    <input type="checkbox" name="ai_relation[]"  value="<?echo $v['name']?>"     title="<?echo $v['name']?>"
        <? if($detail['relation']==$v['name'])   {echo "checked";} ?>>
    <?;}?>

</div>
</div>







    <div class="layui-form-item">
    <label class="layui-form-label">身份证号</label>
    <div class="layui-input-block">
      <input type="text" name="ai_idnumber" placeholder="请输入身份证号" autocomplete="off" class="layui-input" value="<? echo $detail['idnumber']?>">
    </div>

   <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <input type="radio" name="ai_gender" value="男" title="男"
	  <? if($detail['gender']=="男"){echo "checked";} ?>
	  >
      <input type="radio" name="ai_gender" value="女" title="女"
	  <? if($detail['gender']=="女"){echo "checked";} ?>
	  >
    </div>
  </div>


   <div class="layui-form-item">
    <label class="layui-form-label">电话</label>
    <div class="layui-input-block">
      <input type="text" name="ai_phone" placeholder="请输入电话" autocomplete="off" class="layui-input" value="<? echo $detail['phone']?>">
    </div>
  </div>





        <div class="layui-form-item">
            <label class="layui-form-label">常住地址</label>
            <div class="layui-input-block">
                <input type="text" name="ai_address" placeholder="请输入地址" autocomplete="off" class="layui-input" value="<? echo $detail['address']?>" >
            </div>
        </div>








        <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <textarea name="ai_remark" placeholder="备注" class="layui-textarea"><? echo $detail['remark']?></textarea>
    </div>
  </div>










  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>



<input name="navitemed" type="hidden" value="<? echo $_REQUEST['nav-itemed'] ?>"/>
<input name="sys_part" type="hidden" value="<? echo $system_part ?>"/>
<input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
<input name="sortby" type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
<input name="term_nid" type="hidden" value="<? echo $_REQUEST['term_nid'] ?>"/>



</form>



</ul>
</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>


<script>
layui.use('upload', function(){
    var $ = layui.jquery
        ,upload = layui.upload;

    //普通图片上传
    var uploadInst = upload.render({
        elem: '#test1'
        ,url: 'https://httpbin.org/post' //改成您自己的上传接口
        ,accept: 'file' //普通文件
        ,exts: 'jpg|jpeg|png|gif' //只允许上传压缩文件
        ,size: 60 //限制文件大小，单位 KB
        ,before: function(obj){
            //预读本地文件示例，不支持ie8
            obj.preview(function(index, file, result){
                $('#demo1').attr('src', result); //图片链接（base64）
            });
        }
        ,done: function(res){
            //如果上传失败
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            //上传成功
        }
        ,error: function(){
            //演示失败状态，并实现重传
            var demoText = $('#demoText');
            demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
            demoText.find('.demo-reload').on('click', function(){
                uploadInst.upload();
            });
        }
    });




});
</script>


</html>
